package DP.iterator.container.impl;

import DP.iterator.container.Aggregate;
import DP.iterator.iter.impl.ConcreteIterator;
import DP.iterator.iter.Iterator;

import java.util.Vector;

/**
 * @author msi
 * 具体容器类
 */
public class ConcreteAggregate implements Aggregate {

    private Vector vector=new Vector();

    @Override
    public void add(Object o) {
        this.vector.add(o);
    }

    @Override
    public void remove(Object o) {
        this.vector.remove(o);
    }

    @Override
    public Iterator iterator() {
        return new ConcreteIterator(this.vector);
    }
}
